package com.main;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * @Author: Painter
 * @project_name: 五子棋
 * @time: 2022/7/29 18:50
 */


public class ImagesValue {

//    public static File bgFile = new File("src/com/res/bg/6.jpg");   // 加载图像文件
//    public static ImageIcon backgroundImg = new ImageIcon(bgFile.getPath());  // 加载图像图标，使用getImage()获取图片
    public static BufferedImage backgroundImg;  // 定义一个缓冲图像

    public static void init(){
        try {
            backgroundImg = ImageIO.read(new File("src/com/res/bg/6.jpg"));  // 读取图片到指定缓冲图像
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


//    public static Image backgroundImg = Toolkit.getDefaultToolkit().getImage("src/com/res/bg/6.jpg");
    public static Image whiteChess = Toolkit.getDefaultToolkit().getImage("src/com/res/whiteChessman.png");
    public static Image blackChess = Toolkit.getDefaultToolkit().getImage("src/com/res/blackChessman.png");


}
